import {
    Model,
    Table,
    PrimaryKey,
    AutoIncrement,
    Column,
    Sequelize,
    ForeignKey
} from "sequelize-typescript";

import UserModel from './user.model'
import OrganizationModel from './organization.model'

@Table({
    modelName: "member"
})
export default class Member extends Model<Member> {
    @PrimaryKey
    @AutoIncrement
    @Column(Sequelize.INTEGER(64))
    memberId: number;

    @ForeignKey(() => UserModel)
    @Column(Sequelize.INTEGER(64))
    userId: number;

    @ForeignKey(() => OrganizationModel)
    @Column(Sequelize.INTEGER(64))
    organizationId: number;
    
    @Column(Sequelize.INTEGER)
    statue: number;

    @Column(Sequelize.STRING)
    joinForm: string;

    @Column(Sequelize.STRING)
    exitForm: string;
}